package com.biz.primus.ms.price.service;

import com.biz.primus.common.utils.CopyUtils;
import com.biz.primus.base.vo.PriceVo;
import com.biz.primus.ms.base.service.AbstractBaseService;
import com.biz.primus.ms.price.dao.ro.PriceRo;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author jiangnan
 * @Description: TODO
 * @create 2017-10-10-下午3:35
 */
public class AbstractPriceService extends AbstractBaseService {

    protected PriceVo priceRo2PriceVo(PriceRo ro){
        if (ro == null){
            return null;
        }
        PriceVo vo = new PriceVo();
        return CopyUtils.copyProperties(ro, vo);
    }


    protected List<PriceVo> priceRos2PriceVos(List<PriceRo> ros){
        return Lists.transform(ros, this::priceRo2PriceVo);
    }
}
